/* ====================================================================
 * (#)Header: RuleServiceFactory.java
 * (#)Revision: 
 * (#)Date Created: Sep 30, 2011 12:47:15 AM
 * (#)Created By: Karol Wozniak
 * ====================================================================
 *
 * Copyright (c) 2007 karolak .  All rights reserved.
 *
 * ====================================================================
 * 
 * The software application represented here is the sole property of 
 * karolak. Its unauthorized utilization is expressly prohibited.
 * 
 * ====================================================================
 */
package com.karolak.rules;

import com.karolak.rules.drools.RuleReaderProviderDrools;
import com.karolak.rules.jsr94.RuleEngineJsr94;
import com.karolak.service.rules.RuleService;
import com.karolak.service.rules.RuleServiceImpl;

/**
 * <code>RuleServiceFactory</code> is used to ....
 * 
 * @author <a href="mailto:kwozniak@hotmail.com">Karol Wozniak</a>
 */
// TODO when spring is used as factory, this class might be deleted
public class RuleServiceFactory {

	public static RuleService createDrools() {
		String ruleServiceProviderClassName = "org.drools.jsr94.rules.RuleServiceProviderImpl";
		String ruleServiceProviderUri = "http://drools.org/";
		RuleReaderProvider ruleReaderProvider = new RuleReaderProviderDrools();
		RuleEngine ruleEngine = new RuleEngineJsr94(ruleServiceProviderClassName, ruleServiceProviderUri, ruleReaderProvider);
		RuleServiceImpl ruleService = new RuleServiceImpl();
		ruleService.setRuleEngine(ruleEngine);
		return ruleService;
	}
}
